<?
require("config.php");

$location_status .= "| Add";
$show_backnav = "catalog_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

   $field = array(
	"code", 
	"name", 
	"file", 
	"picture",
	"auth",
	);


   $content = array(
	$Code,
	$Name,
	$File_name,
	$Picture_name,
	$Auth,
	);

   myInsert($table,$field,$content);

	$dir = "med_catalog/";

	if ($File) myUpload($File,$File_name,$dir);
	@copy($Picture,"../../../pictures/e-receipt.jpg");
	if ($Picture) myUpload($Picture,$Picture_name,$dir);
	@copy("../../../pictures/med_catalog/".$Picture_name,"../../../pictures/e-receipt.jpg");
	//if ($sm_Picture) myUpload($sm_Picture,"sm_" . $Picture_name,$dir);


   header("location:" . $rela_path . "share/msg.php?v=46");

   exit();

}else{

  if (checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9001");

	exit();
  
  }

}

require($rela_path . "inc/header.php");

?>



<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="add">
<input name="Code" type="hidden" value="<?print($Code)?>">




<table width="95%" border="0" align="center">
  <tr>
    <td valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td valign="top"> <p><br>
        <br>
      <table width="100%" border="0" cellspacing="5" cellpadding="1">
        <tr> 
          <td class="tdheader">Code :</td>
          <td><?print($Code)?></td>
        </tr>






       <!-- <tr> 
          <td class="tdheader">Viewed by member only:</td>
          <td>
<?
$sourceData = array(
1,
0,
);

$sourceLabel = array(
"Yes",
"No",

);

$boxName = "Auth";

$value = $Auth;

FFPRadioBox($boxName,$value,$sourceData,$sourceLabel);


?>

</td>
        </tr>
-->






        <tr> 
          <td class="tdheader">Name :</td>
          <td><input type="text" class="text" name="Name" size="40"></td>
        </tr>
<!--        <tr> 
          <td class="tdheader">Download File :</td>
          <td><input type="File" class="text" name="File" size="40"></td>
        </tr>
-->

          <tr> 
            <td class="tdheader">Picture</td>
            <td>
			
			
			<input type="file" class="text" name="Picture" size="40">

<!--			<br><b>(Smaller Picture)</b><br>
			<input type="file" class="text" name="sm_Picture" size="40">
-->			<br><br>


            </td>
          </tr>




        <tr>
          <td>&nbsp;</td>
          <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('catalog_menu.php',1);return false;"> <input type="image" src="../../images/bt_save.gif">
</td>
        </tr>
      </table>
      <p>
      <p>
      <p>
      <p><br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
      <p>
      <p>
      <p>
      <p> </td>
  </tr>
</table>
<br>
<br>
<br>
<?
require($rela_path . "inc/footer.php");
?>
